#!/usr/bin/env python

import roslib; roslib.load_manifest('faces')
import rospy
from geometry_msgs.msg import PointStamped
from sensor_msgs.msg   import PointCloud
#from standard_msgs.msg import Header

def handler(point):
    cloud = PointCloud()
    cloud.header = point.header
    now = rospy.get_rostime()
    cloud.header.stamp.secs  = now.secs
    cloud.header.stamp.nsecs = now.nsecs
    rospy.loginfo(" Set time to %i %i", now.secs, now.nsecs)
    cloud.points = [point.point]
    pub.publish(cloud)

rospy.init_node('cloudGenerator')
sub = rospy.Subscriber('/target_point', PointStamped, handler)
pub = rospy.Publisher('/faces/cloud', PointCloud)
rospy.spin()
